package net.sk.china.city.talk.model.system;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 后台管理员表
 * +----------------------------------------------------------------------
 * | Talk To [ 聊来改善地区金融服务环境，助力企业发展 ]
 * +----------------------------------------------------------------------
 * | Copyright (c) 2018-2024 聊来All rights reserved.
 * +----------------------------------------------------------------------
 * | Licensed ( <a href="http://www.apache.org/licenses/LICENSE-2.0">apache</a> )
 * +----------------------------------------------------------------------
 * | @Author: 聊来 <18970881148@qq.com>
 * +----------------------------------------------------------------------
 * | DateTime: 2024/6/2 14:40
 * +----------------------------------------------------------------------
 */

@Data
@Accessors(chain = true)
@TableName("db_city")
public class CityAdmin implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "后台管理员表ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "上级id")
    private Integer parentId;

    @ApiModelProperty(value = "分站账号")
    private String account;

    @ApiModelProperty(value = "密码")
    private String pwd;

    @ApiModelProperty(value = "分站名称")
    private String name;

    @ApiModelProperty(value = "分站联系人手机号码")
    private String phone;

    @ApiModelProperty(value = "分站联系人姓名")
    private String realName;

    @ApiModelProperty(value = "后台管理员状态 1有效0无效")
    private Boolean status;

    @ApiModelProperty(value = "后台管理员权限(menus_id)")
    private String roles;

    @ApiModelProperty(value = "城市行政编码")
    private String areaCode;

    @ApiModelProperty(value = "城市id")
    private Integer cityId;

    @ApiModelProperty(value = "后台管理员最后一次登录ip")
    private String lastIp;

    @ApiModelProperty(value = "登录次数")
    private Integer loginCount;

    @ApiModelProperty(value = "账号是否独立，0否，1是")
    private Boolean independent;

    @ApiModelProperty(value = "微信小程序配置")
    private String wxProgram;

    @ApiModelProperty(value = "微信小程序配置")
    private String wxPay;

    @ApiModelProperty(value = "后台管理员添加时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime createTime;

    @ApiModelProperty(value = "后台管理员最后一次登录时间")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime updateTime;

//    @ApiModelProperty(value = "后台管理员级别")
//    private Integer level;
//
//    @ApiModelProperty(value = "是否删除 1是0否")
//    private Boolean isDel;




    public static CityAdmin newDemoAdmin() {
        CityAdmin cityAdmin = new CityAdmin();
        cityAdmin.setId(888);
        cityAdmin.setAccount("17379932951");
        cityAdmin.setPwd("1234567890");
        cityAdmin.setRealName("ygj");
        cityAdmin.setRoles("2");
        cityAdmin.setLastIp("");
        cityAdmin.setUpdateTime(LocalDateTime.now());
        cityAdmin.setCreateTime(LocalDateTime.now());
//        systemAdmin.setLevel(1);
        cityAdmin.setStatus(true);
//        systemAdmin.setIsDel(false);
        cityAdmin.setLoginCount(88);
        cityAdmin.setPhone("17379932951");
        return cityAdmin;
    }
}
